import { defineUserConfig } from "vuepress";
import { getDirname, path } from "vuepress/utils";
import theme from "./theme.js";
import { addViteConfig } from "@vuepress/helper";
import oneTheme from './theme/one.js';
import recoTheme from "./theme/recoTheme.js";
import { locales } from "moment-timezone";
// import { shikiPlugin } from "@vuepress/plugin-shiki";

const __dirname = getDirname(import.meta.url);

export default defineUserConfig({
  base: "/amara/",
  locales: {
    "/": {
      lang: "en-US",
      title: "Growing Up with Amara",
      description: "Record Every Day For Amara",
    },
    "/zh/": {
      lang: "zh-CN",
      title: "与暖暖一起成长",
      description: "记录暖暖的成长",
    },
  },

  theme,

  alias: {
    "/": {
      "@theme-hope/modules/blog/components/BlogHero": path.resolve(
        __dirname,
        "./components/HeroInfo.vue",
      ),
    },
    "/zh/": {
      "@theme-hope/modules/blog/components/BlogHero": path.resolve(
        __dirname,
        "./components/HeroInfo-zh.vue",
      ),
    }
  },

  head: [
    // ['script', { src: 'https://cdn.tailwindcss.com' }],
    ['script', {
      src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3587655547787611',
      crossorigin: 'anonymous',
      async: true
    }],
    ['script', {
      src: 'https://cdn.ampproject.org/v0/amp-ad-0.1.js',
      'custom-element': 'amp-ad',
      async: true
    }],
  ],

  extendsBundlerOptions: (config, app) => {
    // addViteConfig(config, app, {
    //   css: {
    //     postcss: {
    //       plugins: [
    //         require("tailwindcss"),
    //         require("autoprefixer")
    //       ]
    //     }
    //   }
    // })
  }

  // plugins: [
  // shikiPlugin({
  //   // 你的选项
  //   themes: {
  //     light: "github-light",
  //     dark: "one-dark-pro",
  //   },
  // }),
  // ],

  // Enable it with pwa
  // shouldPrefetch: false,
});
